﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;

namespace GestionTaxesRiaApp.Views
{
    public partial class Gestions : Page
    {
        public Gestions()
        {
            InitializeComponent();
            DroitGestion();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void DroitGestion() 
        {
            if (Connexion.utilisateurStatic.uti_IdFonction == Home.lecteurInt
                || Connexion.utilisateurStatic.uti_IdFonction == Home.gestionnaireInt
                || Connexion.utilisateurStatic.uti_IdFonction == Home.administrateurInt)
            {
                GererTarifBtn.Visibility = System.Windows.Visibility.Visible;
                GererReductionBtn.Visibility = System.Windows.Visibility.Visible;
                GererProprietaireBtn.Visibility = System.Windows.Visibility.Visible;
                GererLogementBtn.Visibility = System.Windows.Visibility.Visible;

            }
            if (Connexion.utilisateurStatic.uti_IdFonction == Home.administrateurInt)
            {
                GererUtilisateurBtn.Visibility = System.Windows.Visibility.Visible;
            }
            if (Connexion.utilisateurStatic.uti_IdFonction == Home.decoInt){
                    System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("/GestionTaxesRiaAppTestPage.aspx#/Connexion", UriKind.Relative));
            }
        }

        private void GererLogementBtn_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("/GestionTaxesRiaAppTestPage.aspx#/GestionLogement", UriKind.Relative));
        }

        private void GererProprietaireBtn_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("/GestionTaxesRiaAppTestPage.aspx#/GestionProprietaire", UriKind.Relative));
        }

        private void GererFrequentationBtn_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("/GestionTaxesRiaAppTestPage.aspx#/GestionFrequentation", UriKind.Relative));
        }

        private void GererTarifBtn_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("/GestionTaxesRiaAppTestPage.aspx#/GestionTarif", UriKind.Relative));
        }

        private void GererUtilisateurBtn_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("/GestionTaxesRiaAppTestPage.aspx#/GestionUtilisateur", UriKind.Relative));
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("/GestionTaxesRiaAppTestPage.aspx#/GestionReduction", UriKind.Relative));
        }

       

    }
}
